<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
  <head>
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2008. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>
      Java Code Style Preferences
    </title>
    <link rel="stylesheet" href="../../../book.css" charset="ISO-8859-1" type="text/css">
    <script language="JavaScript" src="PLUGINS_ROOT/org.eclipse.help/livehelp.js" type="text/javascript"> </script>
  </head>
  <body>
    <h1>
      Java Code Style Preferences
    </h1>
<p>The
<a class="command-link" href='javascript:executeCommand("org.eclipse.ui.window.preferences(preferencePageId=org.eclipse.jdt.ui.preferences.CodeStylePreferencePage)")'>
<img src="PLUGINS_ROOT/org.eclipse.help/command_link.svg" alt="Opens the Code Style preference page">
<b>Java &gt; Code Style</b></a> preference page
allows to configure naming conventions, style rules and comment settings.
These preferences are used when new code has to be generated.
</p>

<p>Sub pages offer more code style settings:</p>
 <ul>
  <li><a href="codestyle/ref-preferences-cleanup.htm">Clean Up</a></li>
  <li><a href="codestyle/ref-preferences-code-templates.htm">Code Templates</a></li>
  <li><a href="codestyle/ref-preferences-formatter.htm">Formatter</a></li>
  <li><a href="codestyle/ref-preferences-organize-imports.htm">Organize Imports</a></li>
 </ul>
 
 <p>The options are:</p>


<h2 class="Head">Naming Conventions</h2>
<p>The list defines the naming conventions for fields (static and non-static), parameters and local variables. For each variable type it is possible to configure a list of prefix or suffix or both.<br>
Naming conventions are used by all actions and 'Quick Fix' proposals that create fields, parameters and local variables, in particular the 
<a href="../../ref-menu-source.htm">Source actions</a>.</p>
<table border="1" cellspacing="0" cellpadding="5" width="600" summary="Naming conventions">
	<thead>
		<tr>
			<th>
			<p>Action</p>
			</th>
			<th>
			<p>Description</p>
			</th>
		</tr>
	</thead>
	<tbody>
		<tr>
			<td valign="top" width="25%">
			<p>Edit...</p>
			</td>
			<td valign="top">
			<p>Opens a dialog to edit the list of prefix and suffixes for the currently selected variable type</p>
			</td>
		</tr>
	</tbody>
</table>

<h2 class="Head">Code Conventions</h2>
<p>The following settings specify how newly generated code should look like. The names of getter methods can be specified as well as the format of field accesses, method comments, annotations and exception variables.</p>
<table border="1" cellspacing="0" cellpadding="5" width="600" summary="Code Conventions">
	<thead>
		<tr>
			<th>
			<p>Action</p>
			</th>
			<th>
			<p>Description</p>
			</th>
			<th>
			<p>Default</p>
			</th>
		</tr>
	</thead>
	<tbody>
		<tr>
			<td valign="top" width="25%">
			<p>Qualify all generated field accesses with 'this.'</p>
			</td>
			<td valign="top">
			<p>If selected, field accesses are always prefixed with 'this', regardless whether the name of the field is unique in the scope of the field access or not.</p>
			</td>
			<td valign="top">
			<p>Off</p>
			</td>
		</tr>
		<tr>
			<td valign="top" width="25%">
			<p>Use 'is' prefix for getters that return boolean</p>
			</td>
			<td valign="top">
			<p>If selected, the names of getter methods of boolean type are prefixed with 'is' rather than 'get'.</p>
			</td>
			<td valign="top">
			<p>On</p>
			</td>
		</tr>
		<tr>
			<td valign="top" width="25%">
			<p>Add '@Override' annotation for overriding methods</p>
			</td>
			<td valign="top">
			<p>If selected, methods which override an already implemented method are annotated with an '@Override' annotation. See the
			<a href="../../../reference/preferences/java/ref-preferences-compiler.htm">Compiler preference page</a> for settings related to annotations.</p>
			</td>
			<td valign="top">
			<p>On</p>
			</td>
		</tr>
		<tr>
			<td valign="top" width="25%">
			<p>Exception variable name in catch blocks</p>
			</td>
			<td valign="top">
			<p>Specify the name of the exception variable declared in catch blocks.</p>
			</td>
			<td valign="top">
			<p>e</p>
			</td>
		</tr>
	</tbody>
</table>

<p>
      <h3 class="related">Related references</h3>
      <p>
      <a href="../../../reference/ref-menu-source.htm">Source actions</a><br>
	  <a href="../../../reference/views/ref-java-editor.htm">Java editor</a><br>
	  <a href="ref-preferences-editor.htm">Java editor preferences</a><br>
	  <a href="ref-preferences-compiler.htm">Java compiler preferences</a><br>
	  <a href="codestyle/ref-preferences-code-templates.htm">Code templates preferences</a>
    </p>
    
  </body>
</html>

